﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tanmia.Warehouse.Core;
using FluentNHibernate.Mapping;

namespace Tanmia.Warehouse.NHibernateRepository.Mapping
{
    public class ItemCategoryMap : ClassMap<ItemCategory>
    {
        public ItemCategoryMap()
        {
            Table("ItemCategory");

            Id(x => x.ItemCategoryID).Not.Nullable().GeneratedBy.Identity().Unique();

            Map(x => x.Name).Not.Nullable().Length(50);
            Map(x => x.EngName).Length(50);
            Map(x => x.Code).Length(50);
            Map(x => x.Number).Length(50).Not.Nullable();

            Map(x => x.Notes);
            References(x => x.Parent, "ParentID").Nullable();
        }
    }
}
